(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(add(sqr(X), dbl(X)))
dbl(0) → 0
dbl(s(X)) → s(s(dbl(X)))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(X, activate(Z)))
half(0) → 0
half(s(0)) → 0
half(s(s(X))) → s(half(X))
half(dbl(X)) → X
terms(X) → n__terms(X)
s(X) → n__s(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
terms(z0) → cons(recip(sqr(z0)), n__terms(n__s(z0)))
terms(z0) → n__terms(z0)
sqr(0) → 0
sqr(s(z0)) → s(add(sqr(z0), dbl(z0)))
dbl(0) → 0
dbl(s(z0)) → s(s(dbl(z0)))
add(0, z0) → z0
add(s(z0), z1) → s(add(z0, z1))
first(0, z0) → nil
first(s(z0), cons(z1, z2)) → cons(z1, n__first(z0, activate(z2)))
first(z0, z1) → n__first(z0, z1)
half(0) → 0
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(dbl(z0)) → z0
s(z0) → n__s(z0)
activate(n__terms(z0)) → terms(activate(z0))
activate(n__s(z0)) → s(activate(z0))
activate(n__first(z0, z1)) → first(activate(z0), activate(z1))
activate(z0) → z0
Tuples:
TERMS(z0) → c(SQR(z0))
SQR(s(z0)) → c3(S(add(sqr(z0), dbl(z0))), ADD(sqr(z0), dbl(z0)), SQR(z0), DBL(z0))
DBL(s(z0)) → c5(S(s(dbl(z0))), S(dbl(z0)), DBL(z0))
ADD(s(z0), z1) → c7(S(add(z0, z1)), ADD(z0, z1))
FIRST(s(z0), cons(z1, z2)) → c9(ACTIVATE(z2))
HALF(s(s(z0))) → c13(S(half(z0)), HALF(z0))
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
S tuples:
TERMS(z0) → c(SQR(z0))
SQR(s(z0)) → c3(S(add(sqr(z0), dbl(z0))), ADD(sqr(z0), dbl(z0)), SQR(z0), DBL(z0))
DBL(s(z0)) → c5(S(s(dbl(z0))), S(dbl(z0)), DBL(z0))
ADD(s(z0), z1) → c7(S(add(z0, z1)), ADD(z0, z1))
FIRST(s(z0), cons(z1, z2)) → c9(ACTIVATE(z2))
HALF(s(s(z0))) → c13(S(half(z0)), HALF(z0))
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
K tuples:none
Defined Rule Symbols:
terms, sqr, dbl, add, first, half, s, activate
Defined Pair Symbols:
TERMS, SQR, DBL, ADD, FIRST, HALF, ACTIVATE
Compound Symbols:
c, c3, c5, c7, c9, c13, c16, c17, c18
(3) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)
Removed 1 leading nodes:
FIRST(s(z0), cons(z1, z2)) → c9(ACTIVATE(z2))
Removed 5 trailing nodes:
TERMS(z0) → c(SQR(z0))
HALF(s(s(z0))) → c13(S(half(z0)), HALF(z0))
ADD(s(z0), z1) → c7(S(add(z0, z1)), ADD(z0, z1))
DBL(s(z0)) → c5(S(s(dbl(z0))), S(dbl(z0)), DBL(z0))
SQR(s(z0)) → c3(S(add(sqr(z0), dbl(z0))), ADD(sqr(z0), dbl(z0)), SQR(z0), DBL(z0))
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
terms(z0) → cons(recip(sqr(z0)), n__terms(n__s(z0)))
terms(z0) → n__terms(z0)
sqr(0) → 0
sqr(s(z0)) → s(add(sqr(z0), dbl(z0)))
dbl(0) → 0
dbl(s(z0)) → s(s(dbl(z0)))
add(0, z0) → z0
add(s(z0), z1) → s(add(z0, z1))
first(0, z0) → nil
first(s(z0), cons(z1, z2)) → cons(z1, n__first(z0, activate(z2)))
first(z0, z1) → n__first(z0, z1)
half(0) → 0
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(dbl(z0)) → z0
s(z0) → n__s(z0)
activate(n__terms(z0)) → terms(activate(z0))
activate(n__s(z0)) → s(activate(z0))
activate(n__first(z0, z1)) → first(activate(z0), activate(z1))
activate(z0) → z0
Tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
S tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
K tuples:none
Defined Rule Symbols:
terms, sqr, dbl, add, first, half, s, activate
Defined Pair Symbols:
ACTIVATE
Compound Symbols:
c16, c17, c18
(5) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
We considered the (Usable) Rules:
activate(n__terms(z0)) → terms(activate(z0))
activate(n__s(z0)) → s(activate(z0))
activate(n__first(z0, z1)) → first(activate(z0), activate(z1))
activate(z0) → z0
first(0, z0) → nil
first(z0, z1) → n__first(z0, z1)
s(z0) → n__s(z0)
terms(z0) → cons(recip(sqr(z0)), n__terms(n__s(z0)))
terms(z0) → n__terms(z0)
sqr(0) → 0
And the Tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [1]
POL(ACTIVATE(x1)) = [2]x1
POL(FIRST(x1, x2)) = 0
POL(S(x1)) = 0
POL(TERMS(x1)) = [1]
POL(activate(x1)) = [4] + [2]x1
POL(c16(x1, x2)) = x1 + x2
POL(c17(x1, x2)) = x1 + x2
POL(c18(x1, x2, x3)) = x1 + x2 + x3
POL(cons(x1, x2)) = [2]
POL(first(x1, x2)) = [1] + [3]x1 + [5]x2
POL(n__first(x1, x2)) = x1 + x2
POL(n__s(x1)) = [1] + x1
POL(n__terms(x1)) = [1] + x1
POL(nil) = [2]
POL(recip(x1)) = [5]
POL(s(x1)) = [2] + [5]x1
POL(sqr(x1)) = [4] + [2]x1
POL(terms(x1)) = [5]
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
terms(z0) → cons(recip(sqr(z0)), n__terms(n__s(z0)))
terms(z0) → n__terms(z0)
sqr(0) → 0
sqr(s(z0)) → s(add(sqr(z0), dbl(z0)))
dbl(0) → 0
dbl(s(z0)) → s(s(dbl(z0)))
add(0, z0) → z0
add(s(z0), z1) → s(add(z0, z1))
first(0, z0) → nil
first(s(z0), cons(z1, z2)) → cons(z1, n__first(z0, activate(z2)))
first(z0, z1) → n__first(z0, z1)
half(0) → 0
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(dbl(z0)) → z0
s(z0) → n__s(z0)
activate(n__terms(z0)) → terms(activate(z0))
activate(n__s(z0)) → s(activate(z0))
activate(n__first(z0, z1)) → first(activate(z0), activate(z1))
activate(z0) → z0
Tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
S tuples:
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
K tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
Defined Rule Symbols:
terms, sqr, dbl, add, first, half, s, activate
Defined Pair Symbols:
ACTIVATE
Compound Symbols:
c16, c17, c18
(7) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
We considered the (Usable) Rules:
activate(n__terms(z0)) → terms(activate(z0))
activate(n__s(z0)) → s(activate(z0))
activate(n__first(z0, z1)) → first(activate(z0), activate(z1))
activate(z0) → z0
first(0, z0) → nil
first(z0, z1) → n__first(z0, z1)
s(z0) → n__s(z0)
terms(z0) → cons(recip(sqr(z0)), n__terms(n__s(z0)))
terms(z0) → n__terms(z0)
sqr(0) → 0
And the Tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [5]
POL(ACTIVATE(x1)) = [2]x1
POL(FIRST(x1, x2)) = 0
POL(S(x1)) = [2]
POL(TERMS(x1)) = [3]
POL(activate(x1)) = [4]
POL(c16(x1, x2)) = x1 + x2
POL(c17(x1, x2)) = x1 + x2
POL(c18(x1, x2, x3)) = x1 + x2 + x3
POL(cons(x1, x2)) = [3]
POL(first(x1, x2)) = [4] + [3]x1 + [2]x2
POL(n__first(x1, x2)) = [1] + x1 + x2
POL(n__s(x1)) = [2] + x1
POL(n__terms(x1)) = [3] + x1
POL(nil) = [1]
POL(recip(x1)) = [3]
POL(s(x1)) = [3] + [5]x1
POL(sqr(x1)) = [5]x1
POL(terms(x1)) = [4] + [4]x1
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
terms(z0) → cons(recip(sqr(z0)), n__terms(n__s(z0)))
terms(z0) → n__terms(z0)
sqr(0) → 0
sqr(s(z0)) → s(add(sqr(z0), dbl(z0)))
dbl(0) → 0
dbl(s(z0)) → s(s(dbl(z0)))
add(0, z0) → z0
add(s(z0), z1) → s(add(z0, z1))
first(0, z0) → nil
first(s(z0), cons(z1, z2)) → cons(z1, n__first(z0, activate(z2)))
first(z0, z1) → n__first(z0, z1)
half(0) → 0
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(dbl(z0)) → z0
s(z0) → n__s(z0)
activate(n__terms(z0)) → terms(activate(z0))
activate(n__s(z0)) → s(activate(z0))
activate(n__first(z0, z1)) → first(activate(z0), activate(z1))
activate(z0) → z0
Tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
S tuples:none
K tuples:
ACTIVATE(n__terms(z0)) → c16(TERMS(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__s(z0)) → c17(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__first(z0, z1)) → c18(FIRST(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
Defined Rule Symbols:
terms, sqr, dbl, add, first, half, s, activate
Defined Pair Symbols:
ACTIVATE
Compound Symbols:
c16, c17, c18
(9) SIsEmptyProof (EQUIVALENT transformation)
The set S is empty
(10) BOUNDS(O(1), O(1))